/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufrgs.jsopa;

/**
 *
 * @author fkrahe
 */
public abstract class Scheduler {

    protected ProcessList readyList;
    protected ProcessList diskList;
    protected Disco dis;
    protected ProcessDescriptor process;

    public Scheduler(Disco disk) {
        this.dis = disk;

        readyList = new ProcessList();
        diskList = new ProcessList();

        ProcessDescriptor aux = new ProcessDescriptor(456);
        readyList.pushBack(aux);
        aux.setPC(0);

        readyList.getBack().setPC(0);
        readyList.pushBack(new ProcessDescriptor(457));
        readyList.getBack().setPC(30);
    }

    public void saveContext(int PC, int[] registers) {
        readyList.getFront().setPC(PC);
        readyList.getFront().setReg(registers);
    }

    public abstract void treatInterruption(int intNumber);

    public ProcessDescriptor getProcess() {
        return process;
    }
}
